<?php
class sinanavWidget extends Widget {

	public function render(){
		session_start();
		$sina_token_model = $this->model('sina_token');
		$tokendata = $sina_token_model->from('sina_token')->where('userid=?', 1)->select();
		set_include_path(dirname(dirname(__FILE__)) . '/extensions/sina/');
		include_once( 'config.php' );
		include_once( 'saetv2.ex.class.php' );
		$c = new SaeTClientV2( WB_AKEY , WB_SKEY , $tokendata[0]['access_token'] );
		$uid_get = $c->get_uid();
		$uid = $uid_get['uid'];
		$user_message = $c->show_user_by_id( $uid);//根据ID获取用户等基本信息

		// print_r($user_message);
		$this->assign('data' , $user_message);
		 //display widget
        		$this->display();
	}	
}